package com.bawei.module_home.model.service

import com.bawei.library_net.RetrofitManager
import com.bawei.library_net.entity.ResponseEntity
import com.bawei.module_home.model.api.CommentApi
import com.bawei.module_home.model.api.FocusApi
import com.bawei.module_home.model.entity.CommentEntity
import com.bawei.module_home.model.entity.FocusEntity
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 * @Author : yaotianxue
 * @Time : On 2023/6/27 10:13
 * @Description : FocusService
 */
class CommentService {
    private val api:CommentApi
    init {
        api = RetrofitManager.instance.create(CommentApi::class.java)
    }
    //获得评论
    suspend fun getComments(datatype:Int,itemid:String):ResponseEntity<MutableList<CommentEntity>>{
        return api.getComments(datatype,itemid)
    }
    //发表评论
    suspend fun publishComment( entity: CommentEntity):ResponseEntity<CommentEntity>{
        return api.publishComment(entity)
    }
}
